import con from 'public/req_api'

export default {
    tab_header: (state, item) => {
        state.header_tab = item;
    },
    update_menuIndex: (state, item) => {
        state.menuActive = item
    },
    classBlocks_ID: async(state, item) => {

        state.classBlock_ID = item.id;

        await con.getCommunity_article(item).then((data) => {
            if (!state.article_list.length)
                state.article_list = data.Rows.map((item) => {

                    return item
                })
            else
                state.article_list = state.article_list.concat(data.Rows)
        })

    },
    Statistics_block: (state, item) => {
        state.statistics = item;
    },
    update_ArticleID: (state, item) => {
        state.article_id = item
    },
    update_pagination: (state, item) => {
        state.iPage = item
    }
}